from rest_framework import pagination
from rest_framework.response import Response


class PageNumberPagination(pagination.PageNumberPagination):
    # page_size = 5
    # page_query_param = 'size'
    # max_page_size = 100

    def get_paginated_response(self, data):
        # return Response({
        #     'count': self.page.paginator.count,
        #     'next': self.get_next_link(),
        #     'previous': self.get_previous_link(),
        #     'results': data,
        # })
        return Response({
            'pagination': {
                'total': self.page.paginator.count,
                'page': self.page.number,
                'size': self.page_size,
            },
            'results': data
        })
